import {
    _get,
    _post
} from '../../utils/request'
import util from '../../utils/util'
const app = getApp()
Page({
    data: {
        result: '',
    },
    getMessage() {
        let params = {
            itemId: app.reviewing_id,
            itemName: ''
        }
        _get(`/ReCheck/selectResultByItemId`, params).then(res => {
            res.data.templateItem.forEach(item => {
                item.itemResult = JSON.parse(item.itemResult)
            })
            res.data.attachTable.forEach(item => {
                    item.content = JSON.parse(item.content)
                })
                // console.log(res);
            console.log('检测结果', res.data.templateItem);
            console.log('检测附表', res.data.attachTable);
            this.setData({
                result: res.data,
                test: res.data.templateItem,
                fubiao: res.data.attachTable
            })

        })
    },
    pass() {
        let params = {
            itemId: app.reviewing_id,
            modify: 1,
            userId: app.userId
        }
        _get(`/ReCheck/re_check_pass`, params).then(res => {
            console.log('通过', res);
            dd.redirectTo({
                url: '/pages/review/review'
            })
        })
    },
    reject() {
        let params = {
            itemId: app.reviewing_id,
            modify: 2,
            userId: app.userId
        }
        _get(`/ReCheck/re_check_pass`, params).then(res => {
            console.log('驳回', res);
            dd.redirectTo({
                url: '/pages/review/review'
            })
        })
    },
    onLoad() {
        this.getMessage()
    },
});